Apply PageSetup (3 replies) Posted by: Samir Date: Jan/20/04 - 18:00 (GMT) I hope this is not a repeated question. In AutoCAD 2002, how I can get the list of PageSetup(s) inside a drawing file and apply certain one to one or all layouts? Any help is appreciated. Thanks Samir -------------------------------------------------------------------------------- Reply From: Jason Piercey Date: Jan/20/04 - 19:11 (GMT) Re: Apply PageSetup Here is one way to get the job done. ; Jason Piercey . May 16th, 2003 ; assign a pagesetup to a layout ; [document] - vla-object, layout object ; [layout] - string, layout name ; [setup] - string, pagesetup to assign ; return: T or nil ; example: (putPagesetup [document] [layout] [setup]) ; revised: July 27th, 2003 ; trimmed off the fat and used (vl-catch-all.....) (defun putPagesetup (document layout setup) (if (vl-catch-all-error-p (vl-catch-all-apply (function (lambda () (vla-copyfrom (vla-item (vla-get-layouts document) layout) (vla-item (vla-get-plotconfigurations document) setup) ) ) ) ) ) nil t ) ) To assign a pagesetup named "test" to all layouts defined in the current document. (setq *doc* (vla-get-activedocument (vlax-get-acad-object))) (foreach x (layoutlist) (putPagesetup *doc* x "test")) -Jason Member of the Autodesk Discussion Forum Moderator Program ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Another method: This will setup the current layout tab If you want to define which tab to edit change the line : "" ;current layout tab (command "-PLOT" "Y" ;askes for detailed info "" ;current layout tab "DesignJet 650C c2859b.pc3"; printer "ARCH E1 (30.00 x 42.00 Inches)";papersize "I";paper units (Inches or Millimeters) "L";Lanscape or Portrait "N";Plot upside down? "E";Plot area [Display/Extents/Limits/View/Window] "1:1";Plot scale "C";Plot offset or Center "Y";Plot with plot styles? "KRHA.stb";plot style table "Y";plot with lineweights? "N";remove hidden lines "N";Write the plot to a file? "Y";Save changes to the current tab? "N";Proceed with plot?;;;;;;;;;;;;;;;;;;;;;;THIS LINE IS THE KEY TO SETTING THE ACTIVE PAGESETUP WITHOUT ACTUALLY PLOTTING!!!!!!!!!!! ) or for short. (take off the wordwrap.) (command "-PLOT" "Y" "" "DesignJet 650C c2859b.pc3" "ARCH E1 (30.00 x 42.00 Inches)" "I" "L" "N" "E" "1:1" "C" "Y" "KRHA.stb" "Y" "N" "N" "Y" "N")